﻿<div class="container-fluid b-space">
    <div class="row" style="margin-top: 10px">
        <div class="col-xs-5 col-xs-offset-2">
            <div class="input-group input-group-sm">
                <span class="input-group-addon">报案时间</span>
                <input type="text" class="form-control" ng-datepicker ng-model="search.condition.report_time.start"/>
                <span class="input-group-addon">至</span>
                <input type="text" class="form-control" ng-datepicker ng-model="search.condition.report_time.end"/>
            </div>
        </div>
        <div class="col-xs-2">
            <div class="btn-group btn-group-sm">
                <button type="button" class="btn btn-primary" ng-click="search.from_server()">搜索</button>
                <button type="button" class="btn btn-success" ng-click="search.export()">
                    导出
                </button>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12">
            <table width="100%" class="table no-wrap" style="width: 100%; margin: 0;">
                <tbody>
                    <tr style="font-weight: normal;">
                        <td>
                            <label>
                                <input type="checkbox" ng-click="search.condition.fields.select_toggle('insurant_name')" ng-checked="search.condition.fields.selected.exist('insurant_name')"/> 姓名
                            </label>
                        </td>
                        <td>
                            <label>
                                <input type="checkbox" ng-click="search.condition.fields.select_toggle('insurant_habitation')" ng-checked="search.condition.fields.selected.exist('insurant_habitation')"/> 居住地
                            </label>
                        </td>
                        <td>
                            <label>
                                <input type="checkbox" ng-click="search.condition.fields.select_toggle('accident_time')" ng-checked="search.condition.fields.selected.exist('accident_time')"/> 出险时间
                            </label>
                        </td>
                        <td>
                            <label>
                                <input type="checkbox" ng-click="search.condition.fields.select_toggle('report_time')" ng-checked="search.condition.fields.selected.exist('report_time')"/> 报案时间
                            </label>
                        </td>
                        <td>
                            <label>
                                <input type="checkbox" ng-click="search.condition.fields.select_toggle('hospital_type')" ng-checked="search.condition.fields.selected.exist('hospital_type')"/> 医院类型
                            </label>
                        </td>
                        <td>
                            <label>
                                <input type="checkbox" ng-click="search.condition.fields.select_toggle('invoice_amount')" ng-checked="search.condition.fields.selected.exist('invoice_amount')"/> 发票金额
                            </label>
                        </td>
                        <td>
                            <label>
                                <input type="checkbox" ng-click="search.condition.fields.select_toggle('deductible_amount')" ng-checked="search.condition.fields.selected.exist('deductible_amount')"/> 免赔额
                            </label>
                        </td>
                        <td>
                            <label>
                                <input type="checkbox" ng-click="search.condition.fields.select_toggle('subtract_amount')" ng-checked="search.condition.fields.selected.exist('subtract_amount')"/> 核减金额
                            </label>
                        </td>
                        <td>
                            <label>
                                <input type="checkbox" ng-click="search.condition.fields.select_toggle('compensation_type')" ng-checked="search.condition.fields.selected.exist('compensation_type')"/> 理赔类型
                            </label>
                        </td>
                        <td>
                            <label>
                                <input type="checkbox" ng-click="search.condition.fields.select_toggle('compensation_amount')" ng-checked="search.condition.fields.selected.exist('compensation_amount')"/> 理赔金额
                            </label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label>
                                <input type="checkbox" ng-click="search.condition.fields.select_toggle('all')"/> 全选
                            </label>
                        </td>
                        <td colspan="9">
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12">
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="dataTable_wrapper">
                        <div id="dataTables-example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                            <div class="row">
                                <div class="col-sm-12">
                                    <table width="100%" class="table table-striped table-bordered table-hover dataTable no-footer dtr-inline no-wrap" role="grid" aria-describedby="dataTables-example_info" style="width: 100%;">
                                        <thead>
                                        <tr role="row">
                                            <th rowspan="1" colspan="1">序号</th>
                                            <th rowspan="1" colspan="1" ng-show="search.condition.fields.selected.exist('insurant_name')">姓名</th>
                                            <th rowspan="1" colspan="1" ng-show="search.condition.fields.selected.exist('insurant_habitation')">居住地</th>
                                            <th rowspan="1" colspan="1" ng-show="search.condition.fields.selected.exist('accident_time')">出险时间</th>
                                            <th rowspan="1" colspan="1">是否报案</th>
                                            <th rowspan="1" colspan="1" ng-show="search.condition.fields.selected.exist('report_time')">报案时间</th>
                                            <th rowspan="1" colspan="1" ng-show="search.condition.fields.selected.exist('hospital_type')">医院类型</th>
                                            <th rowspan="1" colspan="1" ng-show="search.condition.fields.selected.exist('invoice_amount')">发票金额</th>
                                            <th rowspan="1" colspan="1" ng-show="search.condition.fields.selected.exist('deductible_amount')">免赔额</th>
                                            <th rowspan="1" colspan="1" ng-show="search.condition.fields.selected.exist('subtract_amount')">核减金额</th>
                                            <th rowspan="1" colspan="1" ng-show="search.condition.fields.selected.exist('compensation_type')">理赔类型</th>
                                            <th rowspan="1" colspan="1" ng-show="search.condition.fields.selected.exist('compensation_amount')">理赔金额</th>
                                            <th rowspan="1" colspan="1">当前状态</th>
                                        </tr>
                                        </thead><!--ng-class="{even: $even, odd: $odd}"-->
                                        <tbody>
                                        <tr ng-repeat="_case in search.result" ng-dblclick="search.view_case(_case.cid)">
                                            <td>
                                                {{$index + 1}}
                                            </td>
                                            <td ng-show="search.condition.fields.selected.exist('insurant_name')">
                                                {{_case.insurant_name}}
                                            </td>
                                            <td ng-show="search.condition.fields.selected.exist('insurant_habitation')">
                                                {{_case.insurant_habitation}}
                                            </td>
                                            <td ng-show="search.condition.fields.selected.exist('accident_time')">
                                                {{_case.accident_time}}
                                            </td>
                                            <td>
                                                {{_case.is_reported > 0 ? '是' : '否'}}
                                            </td>
                                            <td ng-show="search.condition.fields.selected.exist('report_time')">
                                                {{_case.report_time}}
                                            </td>
                                            <td ng-show="search.condition.fields.selected.exist('hospital_type')">
                                                {{_case.hospital_type}}
                                            </td>
                                            <td ng-show="search.condition.fields.selected.exist('invoice_amount')">
                                                {{_case.invoice_amount}}
                                            </td>
                                            <td ng-show="search.condition.fields.selected.exist('deductible_amount')">
                                                {{_case.deductible_amount}}
                                            </td>
                                            <td ng-show="search.condition.fields.selected.exist('subtract_amount')">
                                                {{_case.subtract_amount}}
                                            </td>
                                            <td ng-show="search.condition.fields.selected.exist('compensation_type')">
                                                {{_case.compensation_type}}
                                            </td>
                                            <td ng-show="search.condition.fields.selected.exist('compensation_amount')">
                                                {{_case.compensation_amount}}
                                            </td>
                                            <td>
                                                {{search.query_name('current_state', _case.current_state, _case.is_submit)}}
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-xs-5">
                                    <div class="dataTables_length">
                                        <label>每页显示
                                            <select ng-change="page.turn_to(0)" ng-model="page.size" class="form-control input-sm" style="height: 25px;">
                                                <option value="15">15</option>
                                                <option value="25">25</option>
                                                <option value="50">50</option>
                                                <option value="100">100</option>
                                            </select>条，共{{page.all_items.last()}}页{{page.record_count}}条记录
                                        </label>
                                    </div>
                                </div>
                                <div class="col-sm-7">
                                    <div class="dataTables_paginate paging_simple_numbers">
                                        <ul class="pagination" style="margin: 0;">
                                            <li ng-click="page.turn_to(0)" ng-disabled="page.filtered.length == 1" class="paginate_button">
                                                <a href="javascript:void(0)">第一页</a>
                                            </li>
                                            <li ng-click="page.turn_to(page.index - 1)" ng-disabled="page.filtered.length == 1" class="paginate_button previous">
                                                <a href="javascript:void(0)">&laquo;</a>
                                            </li>
                                            <li ng-repeat="item in page.filtered track by $index" ng-click="page.turn_to(item - 1)" ng-class="{active: (page.index + 1) == item}" class="paginate_button">
                                                <a href="javascript:void(0)">{{item}}</a>
                                            </li>
                                            <li ng-click="page.turn_to(page.index + 1)" ng-disabled="page.filtered.length == 1" class="paginate_button next">
                                                <a href="javascript:void(0)">&raquo;</a>
                                            </li>
                                            <li ng-click="page.turn_to(page.all_items.length - 1)" ng-disabled="page.filtered.length == 1" class="paginate_button">
                                                <a href="javascript:void(0)">最后一页</a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- /.table-responsive -->
                </div>
                <!-- /.panel-body -->
            </div>
            <!-- /.panel -->
        </div>
    </div>
</div>
<div ng-include="'templates/policy/view_case.html'"></div>